package com.service.impl;

import com.bean.Quality;
import com.dao.QualityMapper;
import com.service.QualityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
public class QualityServiceImpl implements QualityService {

    @Autowired
    private QualityMapper mapper;

    @Override
    @Transactional
    public int save(Quality quality) {
        return mapper.insert(quality);
    }

    @Override
    @Transactional
    public int remove(Quality quality) {
        return mapper.delete(quality);
    }

    @Override
    @Transactional
    public int modify(Quality quality) {
        return mapper.update(quality);
    }

    @Override
    public List<Quality> find(Quality quality) {
        return mapper.select(quality);
    }

    @Override
    public int count(Map<String, Object> map) {
        return mapper.selectCount(map);
    }

    @Override
    public List<Quality> query(Map<String, Object> map) {
        return mapper.selectByPage(map);
    }
}
